package actor.persistence

import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory

/**
 * @Description: 将 cassandra 改为 Redis
 * @Author: DJJ
 * @Date: 2019/12/28 14:17
 */
object PersistenceDemo extends App {

  private val persistenceSystem = ActorSystem("persistenceSystem",ConfigFactory.load("persistence"))
  persistenceSystem.actorOf(EventTracker.props,"stateTeller")
  val calculator = persistenceSystem.actorOf(Calculator.props,"Calculator")

  calculator ! Calculator.Add(3)
  calculator ! Calculator.Add(7)
  calculator ! Calculator.Mul(3)
  calculator ! Calculator.Div(2)
  calculator ! Calculator.Sub(8)
  calculator ! Calculator.Mul(12)
  calculator ! Calculator.ShowResult

  scala.io.StdIn.readLine()

  persistenceSystem.terminate()

}
